<?php /*a:3:{s:71:"D:\phpstudy_pro\WWW\xiaomu\tp\app\admin\view\web\webchapters\index.html";i:1725185058;s:56:"D:\phpstudy_pro\WWW\xiaomu\tp\app\admin\view\layout.html";i:1725115306;s:62:"D:\phpstudy_pro\WWW\xiaomu\tp\app\admin\view\common\table.html";i:1724490455;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>欢迎使用小木CMS内容管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <link rel="stylesheet" href="/zhcms/layui_v2_9_10/css/layui.css" media="all">
    <link rel="stylesheet" href="/zhcms/style.css?v=<?php echo time();?>" media="all">

    <script src="/zhcms/jquery/jquery-3.6.0.min.js" charset="utf-8"></script>
    <script src="/zhcms/layui_v2_9_10/layui.js" charset="utf-8"></script>

</head>
<body>
<blockquote class="layui-elem-quote">
  文章管理
</blockquote>

<div class="layui-btn-container mt15 mb15">

    <button type="button" class="layui-btn layui-btn-radius" onclick="refresh()">刷新</button>
    <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" data-open="web.webadmin/add" id="add">新增文章</button>
    <!-- <button type="button" class="layui-btn layui-btn-danger layui-btn-radius">删除</button> -->

</div>

<style>
    .main{
        display:flex;
        overflow: hidden;
    }
    .main-left{
        width:100px;
        box-shadow: 0 0 10px rgba(0,0,0,0.3);
        z-index: 2;
    }

    .main-mid{
        flex:1;
        overflow-x:scroll;
    }

    .main-right{
        width:150px;
        box-shadow: 0 0 10px rgba(0,0,0,0.3);
        z-index: 2;
    }

    .inner{
        height:60px;
        display: flex;
        align-items: center;
    }
    .usericon{
        height:50px;
        width:50px;
        border-radius: 25px;
        display: block;
        margin:5px;
    }

    .layui-table td{
        height:60px;
    }
</style>

<style>
  .main-right{
    width:200px;
  }
</style>

<div class="main">

  <div class="main-left">
      <table class="layui-table" style="margin:0" lay-even>
          <thead>
            <tr>
              <th>ID</th>
            </tr> 
          </thead>
          <tbody>
              <?php if(is_array($chapters_list) || $chapters_list instanceof \think\Collection || $chapters_list instanceof \think\Paginator): $i = 0; $__LIST__ = $chapters_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
              <tr>
                  <td><?php echo htmlentities((string) $vo['id']); ?></td>
              </tr>
              <?php endforeach; endif; else: echo "" ;endif; ?>
          </tbody>
      </table>
  </div>

  <div class="main-mid">
    <table class="layui-table" style="width:1500px ;margin:0" lay-even>
      <thead>
        <tr>
          <th>封面图片</th>
          <th>标题</th>
          <th>所在分类</th>
          <th>状态</th>
          <th>keywords</th>
          <th>descriptions</th>
          <th>创建时间</th>
        </tr> 
      </thead>
      <tbody>
        <?php if(is_array($chapters_list) || $chapters_list instanceof \think\Collection || $chapters_list instanceof \think\Paginator): $i = 0; $__LIST__ = $chapters_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
          <tr>
            <td><img src="<?php echo htmlentities((string) $vo['cover']); ?>" width="90" height="60" /></td>
            <td><?php echo htmlentities((string) $vo['title']); ?></td>
            <td><?php echo htmlentities((string) $vo['category_name']); ?></td>
            <td>
              <form class="layui-form" action="">
                <input type="checkbox" name="open" lay-skin="switch" lay-filter="switchTest" title="显示|隐藏" <?php if($vo['status'] == 1): ?>checked<?php endif; ?> >
              </form>
            </td>

            <td><a href="javascript:void(0)" title="<?php echo htmlentities((string) $vo['keywords']); ?>"><?php echo htmlentities((string) $vo['keywords_short']); ?></a></td>
            <td><a href="javascript:void(0)" title="<?php echo htmlentities((string) $vo['descriptions']); ?>"><?php echo htmlentities((string) $vo['descriptions_short']); ?></a></td>

            <td><?php echo htmlentities((string) $vo['create_time']); ?></td>
            
          </tr>
        <?php endforeach; endif; else: echo "" ;endif; ?>
      </tbody>
    </table>
    </div>


    <div class="main-right">
      <table class="layui-table" style="margin:0" lay-even >
          <thead>
            <tr>
              <th>操作</th>
            </tr> 
          </thead>
          <tbody>
            <?php if(is_array($chapters_list) || $chapters_list instanceof \think\Collection || $chapters_list instanceof \think\Paginator): $i = 0; $__LIST__ = $chapters_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
              <tr>
                <td>
                  <div class="layui-btn-group">
                    <a href="<?php echo url('web.webchapters/edit',['id'=>$vo['id']]); ?>" type="button" class="layui-btn layui-btn-sm layui-bg-blue">编辑</a>
                    <!-- <button type="button" class="layui-btn layui-btn-sm">预览</button>
                    <button type="button" class="layui-btn layui-btn-sm layui-bg-red">删除</button> -->
                  </div>
                </td>
              </tr>
            <?php endforeach; endif; else: echo "" ;endif; ?>
          </tbody>
      </table>
    </div>




<!-------------main end-------------->
  
</div>

<div id="laypage" style="text-align: center;"></div>


<script>

  layui.use(function(){
    var laypage = layui.laypage;
    // 普通用法
    laypage.render({
      elem: 'laypage',
      count: "<?php echo htmlentities((string) $total); ?>",// 数据总数
      curr:"<?php echo htmlentities((string) $page); ?>"
    });

    $("#laypage a").on("click",function(){
      var page = $(this).attr("data-page");
      window.location.href="<?php echo url('web.webchapters/index'); ?>?page="+page
    })
  });

    var refresh = ()=>{
      window.location.href="<?php echo url('web.webchapters/index'); ?>";
    }

    $(function(){

      $("#add").on("click",function(){

        //window.location.href="/index.php/admin/web.webchapters/add"
        window.location.href="<?php echo url('web.webchapters/add'); ?>";

      })


      $(".js-open").on("click",function(){
        var id = $(this).attr("data-id");

        layer.open({
          type: 2,
          //offset:"t",
          area: ['900px', '520px'],
          title:"修改分类",   
          //content: "<?php echo url('/web.webadmin/edit/id/"+id+"'); ?>",
          content: "<?php echo url('web.webadmin/edit'); ?>?id="+id,
          fixed: false, // 不固定
          maxmin: true,
          shadeClose: true,
        });

      })

})



layui.use(['form'], function(){
    var form = layui.form;
    var layer = layui.layer;
    
    // 指定开关事件
    form.on('switch(switchTest)', function(data){
      // layer.msg('开关 checked：'+ (this.checked ? 'true' : 'false'), {
      //   offset: '6px'
      // });
      // layer.tips('温馨提示：请注意开关状态的文字可以随意定义，而不仅仅是 ON|OFF', data.othis)
    });
})

  </script>
</body>
</html>